﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    public static class ExceptionExtension
    {
        public static IEnumerable<Exception> RecurseInner(this Exception ex)
        {
            while (ex !=null)
            {
                yield return ex;
                ex = ex.InnerException;
            }
        }
    }
}
